package com.csdemos.algs.function;

public class DoubleHashingResearch implements ResearchFunction{
    
    protected HashFunction h1;
    protected HashFunction h2;

    public DoubleHashingResearch(HashFunction hashFunction1, HashFunction hashFunction2) {
        h1 = hashFunction1;
        h2 = hashFunction2;
    }
    
    @Override
    public int next(int key, int i){
        return (h1.hash(key) + i * h2.hash(key)) % m;
    }
    
}
